package metro.napoli.tabimage;

import metro.napoli.util.TouchImageView;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory.Options;
import android.os.Bundle;

public abstract class ImageRoot extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		TouchImageView touch = new TouchImageView(this);
		Options options = new Options();
		options.inSampleSize = 1;
		Bitmap icon = getBitmapImage(options);

		touch.setImageBitmap(icon);
		touch.setMaxZoom(5f);
		setContentView(touch);

	}

	protected abstract Bitmap getBitmapImage(Options options);

	@Override
	protected void onDestroy() {
		recycleBitmap();
		super.onDestroy();
	}

	protected abstract void recycleBitmap();
}
